﻿@{
    ViewBag.Title = "采购价格列表";
    Layout = "~/Views/Shared/_LayoutList.cshtml"; 
}
@(       
 Html.nbGridFor<MaterialPrice>(s =>
 {
     s.Action("List");
     s.ExtParam(new { datetime = @ViewBag.Date });
     s.Columns(c =>
    {
        c.Bind(e => e.Id).IsKey();
        c.Bind(e => e.SupplierId).Hide();
        c.Bind(e => e.SupplierName).Align(GridAlign.Left).AsQuery().AsSearch();
        c.BindEnum(m => m.BigClass, "BigClass").Width(60).AsSearch();
        c.BindEnum(m => m.Category, "MaterialCategory").Width(60).AsSearch();
        c.Bind(e => e.MaterialName).Align(GridAlign.Left).Width(100).AsQuery().AsSearch(SearchControlType.TextBox);
        c.BindEnum(m => m.Specification, "MaterialSpec");
        c.BindEnum(m => m.Unit, "MaterialUnit");
        c.Bind(e => e.Price).AsSearch(SearchControlType.NumberBlock).Width(50).Align(GridAlign.Right);
        c.BindDateTime(e => e.StartDate).AsSearch();
        c.BindDateTime(e => e.EndDate).AsSearch();
        c.Bind(e => e.UpdateUser).Width(60);
        c.BindDateTime(e => e.UpdateDate);
        c.BindTemplate()
            .Template(Url.GridRowEditLink("编辑采购价格"))
            .Template(Url.GridRowDeleteLink("MaterialName"));
    });
     s.Buttons(b =>
      {
          b.BindAddButton("新增采购价格");
          b.BindDeleteButton();
          b.Bind(GridButtonType.Import, "导入采购价格").Action(Url.Action("Import", new { excelKey = "MaterialPrice" }));
      });
 }))
